
cmake_minimum_required(VERSION 2.6)

set(ROOT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(DEPS_DIRECTORY "${ROOT_DIRECTORY}/deps")

project(AnB)

set(ANB_COMMON_DIRECTORY     "${ROOT_DIRECTORY}/common")
set(ANB_NET_DIRECTORY        "${ROOT_DIRECTORY}/net")
set(ANB_PROTO_DIRECTORY      "${ROOT_DIRECTORY}/proto")
set(ANB_COMMON_SRC_DIRECTORY "${ANB_COMMON_DIRECTORY}/src")
set(ANB_NET_SRC_DIRECTORY    "${ANB_NET_DIRECTORY}/src")
set(ANB_PROTO_SRC_DIRECTORY  "${ANB_PROTO_DIRECTORY}/src")
include_directories(
    ${ANB_COMMON_SRC_DIRECTORY}
    ${ANB_NET_SRC_DIRECTORY}
    ${ANB_PROTO_SRC_DIRECTORY}
    )


if(MSVC)
    set (LIBUV_DIRECTORY "${DEPS_DIRECTORY}/libuv")
    include_directories("${LIBUV_DIRECTORY}/include")
    link_directories("${LIBUV_DIRECTORY}/Release/lib")

    set (LIBPROTOBUF_DIRECTORY "${DEPS_DIRECTORY}/protobuf")
    include_directories("${LIBPROTOBUF_DIRECTORY}/src")
    link_directories("${LIBPROTOBUF_DIRECTORY}/vsprojects/Release")

    file(GLOB BOOST_DIRECTORY
        "${DEPS_DIRECTORY}/boost*"
        )
    MESSAGE("found boost: ${BOOST_DIRECTORY}")
    include_directories(${BOOST_DIRECTORY})

    link_directories("${BOOST_DIRECTORY}/stage/lib")
endif(MSVC)


# add sub projects
add_subdirectory(common)
add_subdirectory(proto)
add_subdirectory(net)

add_subdirectory(app)


